import request from '@/utils/request'
// 获取信息
export const sysuser = (params) => {
  return request({
    url: '/sys/user',
    params
  })
}

// 添加员工

export const sysuserget = (data) => {
  request({
    url: '/sys/user',
    method: 'post',
    data
  })
}

// 删除员工

export const sysuserdelter = (id) => {
  request({
    url: `/sys/user/${id}`,
    method: 'delete'

  })
}

// 员工批量导入
export const sysuserbatch = (data) => {
  request({
    url: '/sys/user/batch',
    method: 'post',
    data
  })
}

// 修改个人信息 ， 更新个人信息
export const sysuserid = (data) => {
  return request({
    url: `/sys/user/${data.id}`,
    method: 'put',
    data
  })
}

// 获取员工基本信息
export const employeesidpersonalInfo = (id) => {
  return request({
    url: `/employees/${id}/personalInfo`
  })
}

// 保存员工基本信息

export const employeesidpersonalInfobc = (data) => {
  request({
    url: `/employees/${data.userId}/personalInfo`,
    method: 'PUT',
    data
  })
}

// 查询员工岗位信息
export const employeesidjobs = (id) => {
  return request({
    url: `/employees/${id}/jobs`
  })
}

// 保存员工岗位信息
export const employeesidjobsbc = (data) => {
  request({
    url: `/employees/${data.userId}/jobs`,
    method: 'PUT',
    data
  })
}

// 保存员工权限信息
export const sysuserassignRoles = (data) => {
  request({
    url: `/sys/user/assignRoles`,
    method: 'put',
    data
  })
}
